import { S } from '../../s';
import { IPSChartGridXAxis } from './ipschart-grid-xaxis';
import { IPSChartGridYAxis } from './ipschart-grid-yaxis';
import { IPSDEChart } from './ipsdechart';
import { IPSDEChartGrid } from './ipsdechart-grid';
import { PSDEChartCoordinateSystemControlImplBase2 } from './psdechart-coordinate-system-control-impl-base2';

export class PSDEChartGridImpl
  extends PSDEChartCoordinateSystemControlImplBase2
  implements IPSDEChartGrid
{
  protected pschartgridxaxis0: IPSChartGridXAxis;
  getPSChartGridXAxis0(): IPSChartGridXAxis | null {
    if (this.pschartgridxaxis0 != null) return this.pschartgridxaxis0;
    const value = this.M.getPSChartGridXAxis0;
    if (value == null) {
      return;
    }
    const ipsdechart = this.getParentPSModelObject(S._253) as IPSDEChart;
    if (ipsdechart != null) {
      this.pschartgridxaxis0 = ipsdechart.findPSChartXAxis(
        value,
      ) as IPSChartGridXAxis;
    }
    return this.pschartgridxaxis0;
  }

  protected pschartgridxaxis1: IPSChartGridXAxis;
  getPSChartGridXAxis1(): IPSChartGridXAxis | null {
    if (this.pschartgridxaxis1 != null) return this.pschartgridxaxis1;
    const value = this.M.getPSChartGridXAxis1;
    if (value == null) {
      return;
    }
    const ipsdechart = this.getParentPSModelObject(S._253) as IPSDEChart;
    if (ipsdechart != null) {
      this.pschartgridxaxis1 = ipsdechart.findPSChartXAxis(
        value,
      ) as IPSChartGridXAxis;
    }
    return this.pschartgridxaxis1;
  }

  protected pschartgridyaxis0: IPSChartGridYAxis;
  getPSChartGridYAxis0(): IPSChartGridYAxis | null {
    if (this.pschartgridyaxis0 != null) return this.pschartgridyaxis0;
    const value = this.M.getPSChartGridYAxis0;
    if (value == null) {
      return;
    }
    const ipsdechart = this.getParentPSModelObject(S._253) as IPSDEChart;
    if (ipsdechart != null) {
      this.pschartgridyaxis0 = ipsdechart.findPSChartYAxis(
        value,
      ) as IPSChartGridYAxis;
    }
    return this.pschartgridyaxis0;
  }

  protected pschartgridyaxis1: IPSChartGridYAxis;
  getPSChartGridYAxis1(): IPSChartGridYAxis | null {
    if (this.pschartgridyaxis1 != null) return this.pschartgridyaxis1;
    const value = this.M.getPSChartGridYAxis1;
    if (value == null) {
      return;
    }
    const ipsdechart = this.getParentPSModelObject(S._253) as IPSDEChart;
    if (ipsdechart != null) {
      this.pschartgridyaxis1 = ipsdechart.findPSChartYAxis(
        value,
      ) as IPSChartGridYAxis;
    }
    return this.pschartgridyaxis1;
  }
  get cls(): string {
    return 'PSDEChartGridImpl';
  }
  instanceof(cls: string): boolean {
    if (
      cls == S._de ||
      cls == S._f7 ||
      cls == S._e1 ||
      cls == S._f8 ||
      cls == S._e3
    )
      return true;
    return super.instanceof(cls);
  }
}
